<?php
	$top=mysql_query("select * from phim where linkanh is not null order by view DESC limit 0,5") or die(mysql_error());
?>
<div class="content">
	<?Php 
	while($t=mysql_fetch_array($top))
	{
	?>
    <div class="dock">
        <div>
            <a class="thumbnail tooltip" href="<?Php echo "index.php?key=detail&id=".$t['maphim']."&maloai=".$t['maloai']?>">
            <img src="<?php echo $t['linkthumbnail']?>" alt="<?php echo $t['tenphim']?>" original="<?php echo $t['linkthumbnail']?>"  style="width:125px;height:160px"/>
            </a>
            <div class="tooltip_content">			
            <span class="black"><?PHP echo $t['tenphim'] ?> -|- </span>
                <div class="some_info">
				<?php 
				$chatluong=mysql_query("select * from chatluong where machatluong={$t['machatluong']}")or die(mysql_error());
				$cl=mysql_fetch_array($chatluong);
                $theloai=mysql_query("select tentheloai from cttheloai,theloai,phim where phim.maphim = cttheloai.maphim and cttheloai.matheloai=theloai.matheloai and phim.maphim = {$t['maphim']}") or die(mysql_error());
                $phude=mysql_query("select * from chuyenngu,phim where phim.machuyenngu=chuyenngu.machuyenngu and maphim={$t['maphim']}") or die(mysql_error());
                ?>
                Thể loại: <b><?php while($tl=mysql_fetch_array($theloai)) {echo $tl['tentheloai'];} ?></b><br>
                Chuyển ngữ: <b><?php $pd=mysql_fetch_array($phude); echo $pd['tenchuyenngu']?></b><br>
                Chất lượng: <b><?php echo $cl['tenchatluong']?></b><br>
                </div>
                <?php echo preg_replace("/<img[^>]+\>/i", "(image)",$t['gioithieu'])?>
            </div>
        </div>
        <a class="name" href="<?Php echo "index.php?key=detail&id=".$t['maphim']."&maloai=".$t['maloai']?>"><?php echo $t['tenphim']?></a>
    </div><?php }?>
</div>	
